package com.tian.controller;

import com.tian.pojo.Nav;
import com.tian.service.NavService;
import com.tian.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/nav")
public class NavController {
    @Autowired
    private NavService navService;
    /*
     * 查询左侧权限列表数据,要求查询2级列表数据即可
     * URL: /rights/getRightsList
     * 参数: null
     * 返回值: SysResult对象
     * */
    @GetMapping("/getNavList")
    public SysResult getRightsList(){

        List<Nav> list = navService.getRightsList();
        return SysResult.success(list);
    }
}
